﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.IO;
using Citi.GocAttributes.Domain;
using Citi.GocAttributes.SchedulerUI;
using Citi.RoutineBase;

namespace Citi.GocAttributes.WebUI.Controllers
{
    public class HomeController : ControllerBase
    {
        //
        // GET: /Home/
        public class CurrenAction : ICurrentAction
        {
            public string Description
            {
                set { Console.WriteLine(value); }
            }

            public void StartLog(string message)
            {

            }

            public void StartLogOnFile(string filePath)
            {

            }

            public void StopLog()
            {

            }

            public void StopLogOnFile()
            {

            }
        }

        public ActionResult Index()
        {
            ICurrentAction currentAction = new CurrenAction();
            var referenceDate = DateTime.Today;
            var parameters = new Dictionary<string, object> { { "RobotUsername", @"lac\lac_bra_Ftools" }, { "RobotPassword", "Ferrari3k10" } };
            //new ImportFunction().Start(referenceDate, ref currentAction, parameters);
            //new ImportManagedSegment().Start(referenceDate, ref currentAction, parameters);
            //new ImportManagedGeography().Start(referenceDate, ref currentAction, parameters);
            //new ImportDsmt().Start(referenceDate, ref currentAction, parameters);
            //new ImportGocCodes().Start(referenceDate, ref currentAction, parameters);
            //var pathFunction = Path.Combine(UploadFolder, "Functions_201401.xlsx");
            //Function.Import(pathFunction, referenceDate);

            //var pathManagedSegment = Path.Combine(UploadFolder, "ManagedSegment_201401.xlsx");
            //ManagedSegment.Import(pathManagedSegment, referenceDate);

            //var pathGoc = Path.Combine(UploadFolder, "DSMT_201401.xlsx");
            //Goc.ImportGocs(pathGoc, referenceDate);

            //var pathGocCodes = Path.Combine(UploadFolder, "GOCCodes_201401.xlsx");
            //Goc.ImportGocCodes(pathGocCodes);

            return View();
        }
    }
}
